<template>
  <div class="menubox">
    <div
      class="item"
      @mouseover="showPlay()"
      @mouseout="stopPlay1()"
      :class="{ hoverClass:
            parseInt(num) % 2 === 0 /*, hoverLine: lineFlag === index*/,}"
    ></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: null,
      num: 1,
    };
  },
  methods: {
    showPlay() {
      this.time = setInterval(() => {
        this.num = this.num + 1;
      }, 1000);
    },
    stopPlay1() {
      this.num = 1;
      clearInterval(this.time);
    },
    parseInt() {},
  },
  mounted() {},
};
</script>

<style lang="scss" scoped>
.menubox {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  .item {
    width: 200px;
    height: 200px;
    background: url("../../assets/menu-icon.png");
    background-size: 100% 100%;
    cursor: pointer;
  }
  .hoverClass {
    background: url("../../assets/menu-icon-active.png");
    background-size: 100% 100%;
  }
}
</style>